/**
 * File:		Request.java
 * Project:		Virtual Advisor
 * Module:		Data Management
 * Author:		Rotem Ganel
 * Created:		May 10, 2011
 * Updated:		May 10, 2011
 * Version:		1 (in progress)
 */
package clientSocket;

import java.io.Serializable;

public class Request implements Serializable {
	private static final long serialVersionUID = 7895828380279960468L;

	public static enum TYPE {findUser, getUserType, retrieveCatalog, getDegrees, getUsers, saveUsers, saveCatalog, saveCurriculum};
	
	public final TYPE type;
	public final String[] parameters;
	public final Object object;
	
	public Request(TYPE type) {
		this.type = type;
		this.parameters = null;
		this.object = null;
		
//		System.out.println("New request: " + type);
	}
	
	public Request(TYPE type, String[] parameters) {
		this.type = type;
		this.parameters = new String[parameters.length];
		this.object = null;
		
//		System.out.print("New request: " + type + "/ ");
		for (int i = 0; i < parameters.length; i++) {
			this.parameters[i] = parameters[i];
//			System.out.print(parameters[i] + " ");
		}
//		System.out.println();
	}
	
	public Request(TYPE type, Object object) {
		this.type = type;
		this.parameters = null;
		this.object = object;
		
//		System.out.println("New request: " + type);
	}
}